package com.example.mp.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serializable;
import java.util.List;

/**
 * @auther liujb
 * @date 2021/7/25-9:05
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
// 排除emps，在打印的时候不排除懒加载会失效
@ToString(exclude = "emps")
@TableName(value = "tbl_department")
public class Department extends Model<Department> implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(type=IdType.AUTO)
    private Integer id;

    private String departmentName;

    // emps 不是数据库字段排除
    @TableField(exist = false)
    private List<Employee> emps;


}
